// #include <iostream>
#include <bits/stdc++.h>
using namespace std;

/*
    &在不同的语境中，&的用法不同
        & 取地址    &变量名
        & 按位与    变量1 &变量2
        & 引用      类型名 &引用名=变量名

*/


struct student
{
    char name[20];
    int age;
    int score;
};
void output(struct student *s1)
{
    cout << s1->name << " " << s1->age << " " << s1->score << endl;
}
void output(struct student &s1)
{
    cout << s1.name << " " << s1.age << " " << s1.score << endl;
}

int main()
{
    struct student *s1 = new struct student;
    strcpy(s1->name, "张三");
    s1->age = 18;
    s1->score = 100;
    output(s1);
    delete s1;
    s1 = NULL;

    struct student s2;
    strcpy(s2.name, "李四");
    s2.age = 18;
    s2.score = 99;
    output(s2);
    


    return 0;
}